const _export = {
    /**
     * 格式化音乐时长
     * @param {Number} sec 时长毫秒数
     */
    formatDuration(sec) {
        sec = sec / 1000;
        let min = parseInt(sec / 60);
        if (min < 10) {
            min = '0' + min;
        }
        let second = parseInt(sec % 60);
        if (second < 10) {
            second = '0' + second;
        }

        return min + ':' + second;
    },
    isPromise(obj) {
        return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
    }
};

export default _export;